﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.Serialization;
namespace GSLMS.Entity
{
	/// <summary>
	/// 2.3.34    贷款审议安排历史信息表
	/// </summary>
	[DataContract(IsReference = true)]
	public partial class TB_ADU_CONARRHIS: IObjectWithChangeTracker, INotifyPropertyChanged
	{
		public TB_ADU_CONARRHIS()
		{}
		#region Model
		private long _id;
		private long _proid;
		private Nullable<DateTime> _arrdate;
		private string _arrmembers;
		private long _arrmembersid;
		private string _headman;
		private long _headmanid;
		private string _arrby;
		private long _arrbyid;
		private Nullable<DateTime> _createdate;
		private string _remark;
		private int _status;
		/// <summary>
		/// 记录ID唯一
		/// </summary>
		[DataMember]
		public long ID
		{
			get{return _id;}
			set{
				if ( _id!= value)
				{
					if (ChangeTracker.ChangeTrackingEnabled && ChangeTracker.State != ObjectState.Added)
					{
						throw new InvalidOperationException("属性“ID”是对象键的一部分，不可更改。仅当未跟踪对象或对象处于“已添加”状态时，才能对键属性进行更改。");
					}
					 _id = value;
					OnPropertyChanged("ID");
				}
			}
		}
		/// <summary>
		/// 立项申请记录IDTb_app_proinfo.id
		/// </summary>
		[DataMember]
		public long PROID
		{
			get{return _proid;}
			set{
				if ( _proid!= value)
				{
					 _proid = value;
					OnPropertyChanged("PROID");
				}
			}
		}
		/// <summary>
		/// 审批安排时间
		/// </summary>
		[DataMember]
		public Nullable<DateTime> ARRDATE
		{
			get{return _arrdate;}
			set{
				if ( _arrdate!= value)
				{
					 _arrdate = value;
					OnPropertyChanged("ARRDATE");
				}
			}
		}
		/// <summary>
		/// 审议成员
		/// </summary>
		[DataMember]
		public string ARRMEMBERS
		{
			get{return _arrmembers;}
			set{
				if ( _arrmembers!= value)
				{
					 _arrmembers = value;
					OnPropertyChanged("ARRMEMBERS");
				}
			}
		}
		/// <summary>
		/// 审议成员记录ID
		/// </summary>
		[DataMember]
		public long ARRMEMBERSID
		{
			get{return _arrmembersid;}
			set{
				if ( _arrmembersid!= value)
				{
					 _arrmembersid = value;
					OnPropertyChanged("ARRMEMBERSID");
				}
			}
		}
		/// <summary>
		/// 审议组长
		/// </summary>
		[DataMember]
		public string HEADMAN
		{
			get{return _headman;}
			set{
				if ( _headman!= value)
				{
					 _headman = value;
					OnPropertyChanged("HEADMAN");
				}
			}
		}
		/// <summary>
		/// 审议组长记录ID
		/// </summary>
		[DataMember]
		public long HEADMANID
		{
			get{return _headmanid;}
			set{
				if ( _headmanid!= value)
				{
					 _headmanid = value;
					OnPropertyChanged("HEADMANID");
				}
			}
		}
		/// <summary>
		/// 安排人
		/// </summary>
		[DataMember]
		public string ARRBY
		{
			get{return _arrby;}
			set{
				if ( _arrby!= value)
				{
					 _arrby = value;
					OnPropertyChanged("ARRBY");
				}
			}
		}
		/// <summary>
		/// 安排人记录ID
		/// </summary>
		[DataMember]
		public long ARRBYID
		{
			get{return _arrbyid;}
			set{
				if ( _arrbyid!= value)
				{
					 _arrbyid = value;
					OnPropertyChanged("ARRBYID");
				}
			}
		}
		/// <summary>
		/// 经办时间
		/// </summary>
		[DataMember]
		public Nullable<DateTime> CREATEDATE
		{
			get{return _createdate;}
			set{
				if ( _createdate!= value)
				{
					 _createdate = value;
					OnPropertyChanged("CREATEDATE");
				}
			}
		}
		/// <summary>
		/// 备注
		/// </summary>
		[DataMember]
		public string REMARK
		{
			get{return _remark;}
			set{
				if ( _remark!= value)
				{
					 _remark = value;
					OnPropertyChanged("REMARK");
				}
			}
		}
		/// <summary>
		/// 状态-1待安排，0保存，1提交,3复议
		/// </summary>
		[DataMember]
		public int STATUS
		{
			get{return _status;}
			set{
				if ( _status!= value)
				{
					 _status = value;
					OnPropertyChanged("STATUS");
				}
			}
		}
		#endregion Model

	#region ChangeTracking
	   
	protected virtual void OnPropertyChanged(String propertyName)
	{
	    if (ChangeTracker.State != ObjectState.Added && ChangeTracker.State != ObjectState.Deleted)
	    {
	        ChangeTracker.State = ObjectState.Modified;
	    }
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	protected virtual void OnNavigationPropertyChanged(String propertyName)
	{
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged{ add { _propertyChanged += value; } remove { _propertyChanged -= value; } }
	private event PropertyChangedEventHandler _propertyChanged;
	private ObjectChangeTracker _changeTracker;
	   
	[DataMember]
	public ObjectChangeTracker ChangeTracker
	{
	    get
	    {
	        if (_changeTracker == null)
	        {
	            _changeTracker = new ObjectChangeTracker();
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	        return _changeTracker;
	    }
	    set
	    {
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging -= HandleObjectStateChanging;
	        }
	        _changeTracker = value;
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	    }
	}
	   
	private void HandleObjectStateChanging(object sender, ObjectStateChangingEventArgs e)
	{
	    if (e.NewState == ObjectState.Deleted)
	    {
	        ClearNavigationProperties();
	    }
	}
	   
	protected bool IsDeserializing { get; private set; }
	   
	[OnDeserializing]
	public void OnDeserializingMethod(StreamingContext context)
	{
	    IsDeserializing = true;
	}
	   
	[OnDeserialized]
	public void OnDeserializedMethod(StreamingContext context)
	{
	    IsDeserializing = false;
	    ChangeTracker.ChangeTrackingEnabled = true;
	}
	   
	protected virtual void ClearNavigationProperties()
	{
	}
	
	#endregion

	}
}

